From: Debarshi Ray Date: Mon, 24 Oct 2016 14:58:24 +0000 (+0200) Subject: portalHelper: Use a constant for the host name and URI X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~629 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c4a07fad835f668867fa292cdaae5a48d33a0183;p=gnome-shell.git portalHelper: Use a constant for the host name and URI https://bugzilla.gnome.org/show_bug.cgi?id=769940 --- diff --git a/js/portalHelper/main.js b/js/portalHelper/main.js index 75daf6670..427fd85c5 100644 --- a/js/portalHelper/main.js +++ b/js/portalHelper/main.js @@ -20,6 +20,8 @@ const PortalHelperResult = { }; const INACTIVITY_TIMEOUT = 30000; //ms +const CONNECTIVITY_CHECK_HOST = 'nmcheck.gnome.org'; +const CONNECTIVITY_CHECK_URI = 'http://' + CONNECTIVITY_CHECK_HOST; const CONNECTIVITY_RECHECK_RATELIMIT_TIMEOUT = 30 * GLib.USEC_PER_SEC; const HelperDBusInterface = ' \ @@ -50,7 +52,7 @@ const PortalWindow = new Lang.Class({ this.parent({ application: application }); if (!url) { - url = 'http://nmcheck.gnome.org'; + url = CONNECTIVITY_CHECK_URI; this._originalUrlWasGnome = true; } else { this._originalUrlWasGnome = false; @@ -112,12 +114,12 @@ const PortalWindow = new Lang.Class({ let uri = new Soup.URI(request.get_uri()); if (!uri.host_equal(this._uri) && this._originalUrlWasGnome) { - if (uri.get_host() == 'nmcheck.gnome.org' && this._everSeenRedirect) { + if (uri.get_host() == CONNECTIVITY_CHECK_HOST && this._everSeenRedirect) { // Yay, we got to gnome! decision.ignore(); this._doneCallback(PortalHelperResult.COMPLETED); return true; - } else if (uri.get_host() != 'nmcheck.gnome.org') { + } else if (uri.get_host() != CONNECTIVITY_CHECK_HOST) { this._everSeenRedirect = true; } }